package com.itheima.d6_object_stream;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class Test1ObjectOutputStream {
    public static void main(String[] args) {
        try (
                ObjectOutputStream oos =
                        new ObjectOutputStream(new FileOutputStream("Day18-io-app\\src\\itheimaOut08.txt"));

        ) {
            User u = new User("admin", "张三", 32, "1312312");

            oos.writeObject(u);
            System.out.println("序列化成功！！");

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
